package DesignPattern.BuilderPattern.demo1;

/**
 * Created by User on 2017/12/20.
 */
public class HumanDirector {

    private HumanBuilder humanBuilder;

    public HumanDirector(HumanBuilder humanBuilder) {
        this.humanBuilder = humanBuilder;
    }

    public HumanBuilder getHumanBuilder() {
        return humanBuilder;
    }

    public void setHumanBuilder(HumanBuilder humanBuilder) {
        this.humanBuilder = humanBuilder;
    }

    public Human construct() {
        humanBuilder.buildName();
        humanBuilder.buildGender();
        humanBuilder.buildFather();
        humanBuilder.buildMather();

        return humanBuilder.getResult();
    }

}
